package com.tencent.entity;

import com.tencent.constant.MessageConstant;
import com.tencent.web.controller.MemberController;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author: aiming    @date: 2022/8/12 17:44
 * @description:
 */
@Data
@NoArgsConstructor
public class Result implements Serializable {
    private boolean flag;//执行结果，true为执行成功 false为执行失败
    private String message;//返回结果信息
    private Object data;//返回数据

    public static Result success(Object data) {
        Result result = new Result();
        result.setMessage(MessageConstant.ADD_CHECKITEM_SUCCESS);
        result.setData(data);
        result.setFlag(true);

        return result;

    }

    public static Result error(String message) {
       Result result = new Result();
       result.setMessage(message);
       result.setFlag(false);

       return result;
    }
}
